import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime' // import plugin
import 'dayjs/locale/zh-cn' // import locale
// 处理时间---使用dayjs处理------看文档
dayjs.locale('zh-cn') // use locale配置语言环境
export const toDay = (pubdate) => {
  dayjs.extend(relativeTime)
  var a = dayjs()
  var b = dayjs(pubdate)
  return a.to(b) // in 2 years
}
